package com.example.movie_shop.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.movie_shop.entry.Cart;
import com.example.movie_shop.service.CartService;
import com.example.movie_shop.mapper.CartMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author firefly
* @description 针对表【cart】的数据库操作Service实现
* @createDate 2023-12-01 17:17:19
*/
@Service
public class CartServiceImpl extends ServiceImpl<CartMapper, Cart>
    implements CartService{

    @Autowired
    private CartMapper cartMapper;

    @Override
    public boolean isAdd(Cart cart) {
        Cart cart1 = cartMapper.selectOneByUidAndMovieId(cart.getUid(),cart.getMovieId());
        return cart1==null?false:true;
    }
}




